import numpy as np
def check_data(data,threshold=1.5):
    data=np.array(data)
    mean=np.mean(data)
    std=np.std(data)
    print(threshold*std)
    print(mean)
    jiance=np.where(np.abs(data[-50:]-mean)>threshold*std)
    return jiance[0].tolist()
data=[np.random.randint(-30,30)*0.01+23.4 for _ in range(100)]
data[-1]=23.8
data[-2]=23.8
print(data)
print("异常值得索引：",check_data(data),"异常数量：",len(check_data(data)))
